﻿@using umbraco.MacroEngines
@inherits DynamicNodeContext
@{
    var subItems = @Model.AncestorOrSelf(2).Descendants("Textpage").Where("Visible");
    <ul class="nav nav-tabs nav-stacked">
        @foreach (var item in subItems.Count() > 0 ? subItems : Model.AncestorOrSelf().Children.Where("Visible"))
        {
            var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"active\"" : string.Empty;
            <li@Html.Raw(selected)><a href="@item.Url">@item.Name</a></li>
        }
    </ul>
}


